package com.av.bcacc.javaapi.thread.demo;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class CallAbleTest {
    public static void main(String[] args) {
        CallAble001 callAble001=new CallAble001();
        FutureTask<String> futureTask=new FutureTask(callAble001);
        Thread thread=new Thread(futureTask);
        thread.start();
        try {
          String result=  futureTask.get();
            System.out.println("result:"+result);
        } catch (ExecutionException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
